package com.itheima.crops.pojo;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "t_pcrops", schema = "farm", catalog = "")
public class Pcrops {
    @Id
    private Integer id;
    private String name;
    private String alias;
    private String lauraceae;
    private String synopsis;
    private String region;
    private String aspect;
    private String cultivation;
    private String stage;

    @Id
    @Column(name = "id")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "alias")
    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    @Basic
    @Column(name = "lauraceae")
    public String getLauraceae() {
        return lauraceae;
    }

    public void setLauraceae(String lauraceae) {
        this.lauraceae = lauraceae;
    }

    @Basic
    @Column(name = "synopsis")
    public String getSynopsis() {
        return synopsis;
    }

    public void setSynopsis(String synopsis) {
        this.synopsis = synopsis;
    }

    @Basic
    @Column(name = "region")
    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    @Basic
    @Column(name = "aspect")
    public String getAspect() {
        return aspect;
    }

    public void setAspect(String aspect) {
        this.aspect = aspect;
    }

    @Basic
    @Column(name = "cultivation")
    public String getCultivation() {
        return cultivation;
    }

    public void setCultivation(String cultivation) {
        this.cultivation = cultivation;
    }

    @Basic
    @Column(name = "stage")
    public String getStage() {
        return stage;
    }

    public void setStage(String stage) {
        this.stage = stage;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Pcrops that = (Pcrops) o;
        return id == that.id &&
                Objects.equals(name, that.name) &&
                Objects.equals(alias, that.alias) &&
                Objects.equals(lauraceae, that.lauraceae) &&
                Objects.equals(synopsis, that.synopsis) &&
                Objects.equals(region, that.region) &&
                Objects.equals(aspect, that.aspect) &&
                Objects.equals(cultivation, that.cultivation) &&
                Objects.equals(stage, that.stage);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, alias, lauraceae, synopsis, region, aspect, cultivation, stage);
    }
}
